fix: reduce exit delay after task completion (v0.1.5) #7
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
After
✔ 🎉 All 11 tasks completed successfully!appears, there was a noticeable long delay (sometimes several seconds) before terminal control returned to the user, slowing down the workflow.Root Cause
The
runcommand was starting iteration checkpoint commits asynchronously via theiterationEndevent handler without awaiting them. These git operations (invoking hooks, LFS, commit signing, auto-push) could continue running after the final success message was printed, keeping the Node.js event loop alive and delayingprocess.exit().Solution
checkpointQueue: Promise<void>) toeliminate concurrency issues
await engine.start(activeTask)completes
printing final output
Changes
Code
src/commands/run.ts:checkpointQueuepromise chain for serialized checkpoint creation.then(async () => {...})await checkpointQueueright after task completion to flush before finaloutput
Documentation
README.md→ Troubleshooting section:autoCommit: falseautoPush: false/pushStrategy: manual.git/hooks/Version
package.jsonversion from0.1.4→0.1.5Testing
✅ All 311 tests pass
✅ Linting passes
✅ TypeScript compilation successful
✅ Build successful
Impact
Related Issue
Resolves long delays reported when running multi-task workflows with git-intensive environments (Husky hooks, LFS, commit signing enabled).